import re
import requests
import json
import baozou_insert_sql
def tiantianyun1_sum():
    r = requests.session()
    Platform = "天天云1_畅听书斋"
    # 甜心爱看书
    url = "http://api.gungunbook.net/Login.php"
    date = {
        "user_name": "",
        "password": ""
    }
    rr = r.post(url=url,data=date)
    ht = json.loads(rr.text)
    bb = ht["msg"]
    aa = r.get(url="http://api.gungunbook.net/Consume.php?action=daily&sId={0}".format(bb))
    html = json.loads(aa.text)
    date_time = html["content"][1]["time"]
    Amount_share = int(html["content"][1]["count_consume"])*0.9
    Amount_share = round(Amount_share, 2)
    # print(date_time,Amount_share)
    baozou_insert_sql.baozou_spider_everyday_sum(date_time,Amount_share,Platform)




